home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part2 / 13156 < prev    next >
Encoding:
Text File  |  1996-08-05  |  3.0 KB  |  60 lines

  1. Path: dimensional.com!news
  2. From: cjames@melchizedek.cec-services.com (The Right Reverend Colin James III)
  3. Newsgroups: comp.object,comp.lang.c++,comp.lang.java
  4. Subject: Re: What Should An Exception Handling Do? -- Clarification of rules
  5. Date: Sat, 23 Mar 1996 13:27:29 GMT
  6. Organization: CEC Services, LLC
  7. Message-ID: <3153fbd5.981409992@news.dimensional.com>
  8. References: <1996Mar14.155641.4299@schbbs.mot.com> <4irn11$7ln@mimas.brunel.ac.uk> <Pine.Sola.3.91.960322041345.17711C-100000@ux5.cso.uiuc.edu> <4j03p4$fbt@hoho.quake.net>
  9. Reply-To: cjames@melchizedek.cec-services.com
  10. NNTP-Posting-Host: melchizedek.cec-services.com
  11. X-Newsreader: Forte Agent .99d/32.182
  12.  
  13. billf@jovial.com (Bill Foote) posted with deletions:
  14.  
  15. | In article <Pine.Sola.3.91.960322041345.17711C-100000@ux5.cso.uiuc.edu>,
  16. | Matthew Travis  <mtravis@students.uiuc.edu> wrote:
  17. | >H'llo,
  18. | >    for clarification, Java uses the same exception handling 
  19. | >mechanism as C++ (with the addition of the finally clause). The two 
  20. | >possible mechanisms are "resumption" and "termination". A quote from the  
  21. | >"Annotated C++ Reference Manual" states:
  22. | >
  23. | >    "Exception handling is intended to allow code that has encountered 
  24. | >a condition it cannot cope with to return to some other code that 
  25. | >directly or indirectly invoked it. There is no way for an exception 
  26. | >handler to request the thread of control to resume from the throw point. 
  27. | >In other words, "throw" implements the termination model of exception 
  28. | >handling."     -ARM, Ellis & Stroustrup, page 354
  29. | >
  30. | >This model has been accepted into the draft C++ standard and is also the 
  31. | >model Java uses. The philosophy is that an exception indicates some error 
  32. | >condition that is usually unrecoverable and code that is in error should 
  33. | >terminate (thinking about it logically).
  34. | A cynic might conclude something more along these lines:  "It would be hard
  35. | to implement resumable exceptions in C++, so they decided to punt."
  36. | It's not too hard to come up with examples where it would be nice to have
  37. | resumable exceptions.  One example is resource acquisition.  Upon failure
  38. | to acquire a resource (a file descriptor, some memory, etc.) it might be
  39. | nice if a top-level exception handler could try to free up some resources,
  40. | and if it can, try to resume from the exception.
  41. | Oh well.
  42. | --
  43. | Bill Foote                       |  L'homme est nΘ pour vivre dans les
  44. | billf@jovial.com                 |  convulsions de l'inquiΘtude ou dans la
  45. | http://www.jovial.com/~billf/    |  lΘthargie de l'ennui       -- Voltaire
  46.  
  47. Cross-posted to six usenet groups [ in the original ], the above has
  48. nothing whatsoever to do with Eiffel or comp.lang.eiffel, so remove it
  49. therefrom now.
  50.  
  51. ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~
  52. Colin James III, Principal Scientist  cjames@cec-services.com
  53. CEC Services, 2080 Kipling St, Lakewood, CO  80215-1502   USA
  54. Voice: 303.231.9437;  Facsimile: .231.9438;  Data:  .231.9434  
  55. ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~
  56.